<?php
  header('content-type','application/x-www-form-urlencoded');
  $f = file_get_contents("https://shop.vivo.com.cn/api/v1/channel/getDetail");
  $data = json_decode($f);
  if($data->{'msg'}=='成功'){
      echo json_encode($data->{'data'});
  }else{
    $conn = mysqli_connect('127.0.0.1','root','root','vivo');
    $sql = "SELECT * FROM `sku`";
    $res = mysqli_query($conn,$sql);
    $data = mysqli_fetch_all($res,MYSQLI_ASSOC);
    echo json_encode($data);
  }


?>